package de.hochschuletrier.bachelor.antfarm.settings;

public class Settings {	
	/**
	 * Anzahl der berechneten Frames pro Sekunde
	 */
	private static float calculatedFramesPerSecond;
	
	/**
	 * Wieviele letzte Positionen darf sich eine Ameise merken
	 */
	private static int antMaxPositions;
	
	/**
	 * Wieweit soll Ausschnitt verschoben werden
	 */
	private static float translateX, translateY;
	
	/**
	 * Wieweit soll Ausschnitt in einer Sekonde verschoben werden können
	 */
	private static float translatePerSecond;
	
	/**
	 * Zoom
	 */
	private static float scale;
	
	/**
	 * Ab welchem Abstand sieht eine Ameise ein Nest
	 */
	private static float seeDistanceToNest = 4f;

	/**
	 * Mit wievielen Futterquellen soll begonnen werden
	 */
	public final static int foodsourcesAtBegin = 15;

	/**
	 * Chance, dass eine neue Futterquelle bei einem Update erscheint 
	 */
	private static float chanceForNewFoodsource = 0.005f;

	/**
	 * TTL für Pheromon 
	 */
	private static int pheromonTimeToLive = 800;

	public static void init() {
		calculatedFramesPerSecond = 1f;
		antMaxPositions = 10;
		translateX = 0;
		translateY = 0;
		translatePerSecond = 500;
		scale = 1f;
	}
	
	public static float getCalculatedFramesPerSecond() {
		return calculatedFramesPerSecond;
	}
	
	public static void setCalculatedFramesPerSecond(float calculatedFramesPerSecond) {
		Settings.calculatedFramesPerSecond = calculatedFramesPerSecond;
	}

	public static void increaseCalculatedFramesPerSecond() {
		if (getCalculatedFramesPerSecond() > 0)
			setCalculatedFramesPerSecond(getCalculatedFramesPerSecond() * 2f);
		else
			setCalculatedFramesPerSecond(0.25f);
	}

	public static void decreaseCalculatedFramesPerSecond() {
		setCalculatedFramesPerSecond(getCalculatedFramesPerSecond() / 2f);
		if (getCalculatedFramesPerSecond() < 0.2f) {
			setCalculatedFramesPerSecond(0f);
		}
	}

	public static int getMaxPositions() {
		return antMaxPositions;
	}

	public static float getTranslateX() {
		return translateX;
	}

	public static void setTranslateX(float translateX) {
		Settings.translateX = translateX;
	}

	public static float getTranslateY() {
		return translateY;
	}

	public static void setTranslateY(float translateY) {
		Settings.translateY = translateY;
	}

	public static float getTranslatePerSecond() {
		return translatePerSecond;
	}

	public static void setTranslatePerSecond(float translatePerSecond) {
		Settings.translatePerSecond = translatePerSecond;
	}

	public static float getScale() {
		return scale;
	}

	public static void setScale(float scale) {
		Settings.scale = scale;
	}

	public static float getSeeDistanceToNest() {
		return seeDistanceToNest;
	}

	public static void setSeeDistanceToNest(float seeDistanceToNest) {
		Settings.seeDistanceToNest = seeDistanceToNest;
	}

	public static float getChanceForNewFoodsource() {
		return chanceForNewFoodsource;
	}

	public static void setChanceForNewFoodsource(float chanceForNewFoodsource) {
		Settings.chanceForNewFoodsource = chanceForNewFoodsource;
	}

	public static int getPheromonTimeToLive() {
		return pheromonTimeToLive;
	}

	public static void setPheromonTimeToLive(int pheromonTimeToLive) {
		Settings.pheromonTimeToLive = pheromonTimeToLive;
	}
}
